 /**
   * Copyright 2014 Viettel Telecom. All rights reserved.
   * VIETTEL PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
   */
 package com.viettel.core.bussiness.cms; 
import java.util.List; 

import org.springframework.beans.factory.annotation.Autowired; 

import com.viettel.core.exceptions.BusinessException; 
import com.viettel.core.exceptions.DataAccessException; 
import com.viettel.core.dao.cms.MediaArticleDAO;
import com.viettel.core.entities.cms.MediaArticle;
 /**
   *  Mo ta muc dich cua lop (interface)
   *  @author: TOANTM1
   *  @version:  
   *  @since: 27/02/2014 - 11:34:02
   */
 public class MediaArticleMgrImpl implements MediaArticleMgr{ 
	@Autowired 
	MediaArticleDAO mediaarticleDAO; 
 
 	/**@author TOANTM1
  	 * 27/02/2014 - 11:34:02
  	 * For: 
  	 * @description: 
  	 */
 	@Override 
	public MediaArticle getMediaArticleById(Integer id) throws BusinessException { 
		try { 
			return  mediaarticleDAO.getMediaArticleById(id); 
		} catch (DataAccessException e) { 
			throw new BusinessException(e); 
		} 
	} 
 
 	/**@author TOANTM1
  	 * 27/02/2014 - 11:34:02
  	 * For: 
  	 * @description: 
  	 */
 	@Override 
	public MediaArticle createMediaArticle(MediaArticle mediaarticle) throws BusinessException { 
		try { 
			return mediaarticleDAO.createMediaArticle(mediaarticle); 
		} catch (DataAccessException e) { 
			throw new BusinessException(e); 
		} 
	} 
 
 	/**@author TOANTM1
  	 * 27/02/2014 - 11:34:02
  	 * For: 
  	 * @description: 
  	 */
 	@Override 
	public void updateMediaArticle(MediaArticle mediaarticle) throws BusinessException { 
		try { 
			mediaarticleDAO.updateMediaArticle(mediaarticle); 
		} catch (DataAccessException e) {	 
			throw new BusinessException(e); 
		} 
	} 
 
 	/**@author TOANTM1
  	 * 27/02/2014 - 11:34:02
  	 * For: 
  	 * @description: 
  	 */
 	@Override 
	public void deleteMediaArticle(MediaArticle mediaarticle) throws BusinessException { 
		try { 
			mediaarticleDAO.deleteMediaArticle(mediaarticle); 
		} catch (DataAccessException e) { 
			throw new BusinessException(e); 
		} 
	}
	@Override 
 	public List<MediaArticle> getListMediaArticlesByCmsUserId(Integer id) throws BusinessException{
 		try { 
			return mediaarticleDAO.getListMediaArticlesByCmsUserId(id); 
		} catch (DataAccessException e) { 
			throw new BusinessException(e); 
		} 
 	}
} 
